<?php 
$this->headTitle('Quản lý người dùng', 'append'); 
?>
<div class="grid">
    <div class="breadcrumbs">
        <a class="item-1" href="/index">Trang chủ</a> › 
        <a class="item-2" href="/admin/user"><?php $title = $this->headTitle(); if(isset($title[0])) echo $title[0]; ?></a> › 
        <span class="item-3" href="#">Sửa</span>
        <div class="clear-both"></div>
    </div>
    <div class="box header">Sửa thông tin người dùng</div>
    <div class="box content">
    	<?php
            if(isset($this->mess)){
                if($this->flag == 'success')
                    echo '<div class="notification success">',$this->mess,'</div>';
                elseif($this->flag == 'alert')
                    echo '<div class="notification alert">',$this->mess,'</div>';
                else
                    echo '<div class="notification error">',$this->mess,'</div>';
            }
            echo $this->form;
        ?>
        <?php  if(isset($this->roleList[0])){ ?>
        	<script language="JavaScript" type="text/javascript">
    	  		$("form > dl.zend_form > dd#password-element").after('<div id="role"><dt><label class="optional" >Quyền Hạn</label></dt></div><div class="clr"></div>');
    		</script>
    
    	    <?php foreach($this->roleList as $role){ ?>
    
    		<script language="JavaScript" type="text/javascript">
    	  		$("form > dl.zend_form > div#role").append('<dd style="margin: 0 0 10px 120px;"><input type="hidden" value="<?php echo $role['roleId'] ?>" name="userRole[]"><input text="text" readonly="true" name = "role[]"value="<?php echo $role['roleName']; ?>" /><a class="del" title="xóa" onclick="del(this);"><img src="image/icons/icon_delete.png" /></a>&nbsp;</dd>');
    
    			function del(obj){
    				$(obj).parent().remove();
    
    			}
    		</script>
       <?php  
                }
            }
       ?>
    
    </div>
</div>
